Sets or adds a value to a property name in a JSONObject and returns the modified object.
Syntax
JSONObjectSetValue("JSON", "PropertyName", "Value")
Arguments
| Argument | Description |
|---|---|
| JSON | JSONObject. |
| PropertyName | Property in the JSONObject. If not found, a new property is created. |
| Value | Value to set. Must be a string, integer, float, Boolean, null, JSONObject, or JSONArray. If a JSONObject or JSONArray is used, a copy is created and inserted into the JSONObject. |
Return value
| Value | Description |
|---|---|
| Value | Modified JSONObject. |
Example
strVal = JSONObjectSetValue("{\"propertyName\": \"propertyValue\"}", "propertyName", "new PropertyValue")
PrintLn("Should be \"{\"propertyName\":\"new PropertyValue\"}\": " & strVal)